<extend name="Public:base" />
<block name="title"><title>心e购-首页</title></block>
<block name="resources">
	<style type="text/css">
		header.mui-bar{
			padding: 0;
			border-bottom: none;
			box-shadow: none;
			background: rgba(0,0,0,.3);
		}
		
		.mui-bar-nav~.mui-content{
			padding-top: 0;
		}
		.mui-grid-view.mui-grid-9{
			background: #fff;
		}
		.mui-fullscreen.mui-slider .mui-slider-item>a {
			top: 0;
			-webkit-transform: translateY(0);
			transform: translateY(0);
		}
	</style>
</block>
<block name="body">
	<header class="mui-bar mui-bar-nav">
		<div class="top_bar">
			<a href="xxzx.html" class="wd"><!--有未读消息加class="wd"出现红点显示-->
				<i class="mui-icon mui-icon-email"></i>
			</a>
			<div class="search_box">
				<form action="" method="post">
					<input type="text" name="" class="search" value="" />
					<button class="search_but"><i class="icon iconfont icon-fangdajing"></i></button>
				</form>
			</div>
			<a href="/Wap/Order/index"><i class="mui-icon-extra mui-icon-extra-cart"></i></a>
		</div>
	</header>
	<div class="mui-content">
		<div id="list" class="mui-fullscreen">
			<div class="mui-scroll">
				<div id="slider" class="mui-slider" >
					<div class="mui-slider-group mui-slider-loop">
						<volist name="adlist_a" id="vo">
						<div class="mui-slider-item">
							<a href="javascript:void(0);">
								<img src="{$vo.adv_pic}">
							</a>
						</div>
						</volist>
					</div>
				</div>
				<section>
					<ul class="mui-table-view mui-grid-view mui-grid-9">
						<li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4">
							<a href="/Wap/Product/index">
								<span class="icon_img img1"></span>
								<div class="mui-media-body">产品区</div>
							</a>
						</li>
						<!-- <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4">
							<a href="/Wap/Product/purchase">
								<span class="icon_img img2"></span>
								<div class="mui-media-body">抢购区</div>
							</a>
						</li>
						<li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4">
							<a href="javascript:;" class="ale" id="alertBtn">
								<span class="icon_img img3"></span>
								<div class="mui-media-body">游戏区</div>
							</a>
						</li>
						<li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4">
							<a href="javascript:;" class="ale">
								<span class="icon_img img4"></span>
								<div class="mui-media-body">OTO专区</div>
							</a>
						</li>
						<li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4">
							<a href="javascript:;" class="ale">
								<span class="icon_img img5"></span>
								<div class="mui-media-body">众创区</div>
							</a>
						</li>
						<li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4">
							<a href="javascript:;" class="ale">
								<span class="icon_img img6"></span>
								<div class="mui-media-body">交易区</div>
							</a>
						</li> -->
					</ul>
				</section>
				<!--广告区块-->
				<section class="ggqk">
					<volist name="goods_list" id="voss">
					<div class="gg_list">
						<dl>
							<dt class="gg_list_title"><p class="gg_title">{$voss.gc_name}</p></dt>
							<dd class="list_sp_box">
								<ul class="list_box mui-clearfix">
									<volist name="voss.goods" id="vosss">
									<li class="sp_list">
										<a href="/Wap/product/detail?id={$vosss.id}">
											<div class="img_box">
												<img src="{$vosss.pic}"/>
											</div>
											<div class="gg_list_info">
												<p class="mui-ellipsis-2">
													{$vosss.productname}
												</p>
												<p>
													<span class="color_red">
														<if condition="$vosss.price gt 0">￥{$vosss.price}</if>
														<if condition="$vosss.point_num gt 0">
															<if condition="$vosss.price gt 0">+</if>
															积分：{$vosss.point_num}
														</if>
														<if condition="$vosss.coin_num gt 0">增值币：{$vosss.coin_num}</if>
													</span>
													<!-- <a href="javascript:;" class="mui-pull-right mui-btn mui-btn-danger mui-btn-outlined">购买</a> -->
												</p>
											</div>
										</a>
									</li>
									</volist>
								</ul>
							</dd>
						</dl>
					</div>
					</volist>
					<div class="jrtj">
						<div class="cp_list_box">
							<!-- <div class="area_title">
								<div class="img_box">
									<a href="javasciprt:void(0);">
										<img height="66" src="__PUBLIC__/Wap/images/jrtj.png"/>
									</a>
								</div>
							</div> -->
							<div class="area_body">
								<div class="mui-row sp_list show_list">
									<volist name="goods" id="good">
									<div class="mui-col-sm-6 mui-col-xs-6 sp_list_gruand">
										<a href="/Wap/product/detail?id={$good.id}">
											<div class="img_box">
												<img height="150" src="{$good.pic}"/>
											</div>  
											<div class="jg_box">
												<p class="mui-ellipsis">{$good.productname}</p>
												<p class="mui-ellipsis">{$good.productname}</p>
												<p>
													<if condition="$good.price gt 0">￥{$good.price}</if>
													<if condition="$good.point_num gt 0">
														<if condition="$good.price gt 0">+</if>
														积分：{$good.point_num}
													</if>
													<if condition="$good.coin_num gt 0">增值币：{$good.coin_num}</if>
												</p>
											</div>
										</a>
									</div>
									</volist>
								</div>
							</div>
						</div>
					</div>
				</section>
			</div>
		</div>
	</div>
</block>
<block name="script">
	<script type="text/javascript" charset="utf-8">
		mui("#slider").slider({
			interval: 0
		});
		var peg = 2;
		$show_list = mui('.show_list');
		mui.init({
			pullRefresh: {
				container:"#list",
				up: {
					height: 30,
					contentrefresh : "正在加载...",
					contentnomore:'没有更多数据了',
					callback: function() {
						var _this = this;
						mui.post('/Wap/index/index', { peg: peg}, function(data) {
							if(data == 0) {
								_this.endPullupToRefresh(true);
							} else {
								_this.endPullupToRefresh(false);
								mui.each(data, function(k, v) {
									var html = '<a href="/Wap/product/detail?id=' + v.id + '">';
										html += '<div class="img_box"><img height="150" src="' + v.pic +'"/></div>';
										html += '<div class="jg_box">';
											html += '<p class="mui-ellipsis">' + v.productname +'</p><p class="mui-ellipsis">' + v.productname +'</p>';
											html += '<p>';
											if(v.price > 0) {
												html += '￥' + v.price;
											}
											if(v.point_num > 0) {
												if(v.price > 0) {
													html += "+";
												}
												html += '积分：' + v.point_num;
											}
											if(v.coin_num > 0) {
												html += '增值币：' + v.coin_num;
											}
											html += '</p>';
										html += '</div>';
									html += '</a>';
									var div = document.createElement("div");
									div.className = "mui-col-sm-6 mui-col-xs-6 sp_list_gruand";
									div.innerHTML = html;
									$show_list[0].appendChild(div);
								});
							}
							peg++;
						}, 'json');
					}
				}
			}
		});
	</script>
</block>